<%@ page import="com.dailybule.java.bean.Emp" %>
<%@ page import="com.dailybule.java.service.EmpService" %>
<%@ page import="com.dailybule.java.service.impl.EmpServiceImpl" %><%--
<%--
  Created by IntelliJ IDEA.
  User: whb
  Date: 2024/1/21
  Time: 9:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    //接收传递过来的数据
    request.setCharacterEncoding("utf-8");
    String enname = request.getParameter("enname");
    String mgr = request.getParameter("mgr");
    String job = request.getParameter("job");
    String sal = request.getParameter("sal");
    String comm = request.getParameter("comm");
    String deptNo = request.getParameter("deptNo");
    System.out.println(comm);
    System.out.println(deptNo);
    System.out.println(enname);
    // 封装数据
    Emp emp = new Emp();
    emp.setMgr(Integer.parseInt(mgr));
    emp.setEnname(enname);
    emp.setJob(job);
    emp.setDeptNo(Integer.parseInt(deptNo));
    emp.setComm(Double.parseDouble(comm));
    emp.setSal(Double.parseDouble(sal));
    // 调用service的save方法
    EmpService service = new EmpServiceImpl();
    service.save(emp);
    // 跳转
    response.sendRedirect("../0120/4.jsp");
%>